package day05;
import java.util.Scanner;
public class Addittion {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int score=0; //总分
        int n=0;
        int y=0;
        for (int i = 0; i < 10; i++) {//10次
            //1）出题  2）做题  3）判题
            System.out.println("做吧！");
            int a=(int)(Math.random()*100);
            int b=(int)(Math.random()*100);
            int c=a+b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
            int answer=scanner.nextInt();
            if (answer==c){
                System.out.println("对了");
                score+=10;
                y+=1;
            }else {
                System.out.println("错了");
                n+=1;
            }
        }
        System.out.println("答对"+y+"题");
        System.out.println("答错"+n+"题");
        System.out.println("总分为："+score);

    }
}
